package treeview.unit;

/**
 * Created by Pavel Nikolaev
 */
public abstract class BaseLineView extends AbstractUnitView {
    protected int myDescent = 0;
    protected int myAscent = 0;

    @Override
    public void setDescent(int descent) {
        int delta = myDescent - descent;
        myHeight -= delta;
        myDescent = descent;
    }

    @Override
    public int getDescent() {
        return myDescent;
    }

    @Override
    public void setAscent(int ascent) {
        final int delta = myAscent - ascent;
        myHeight -= delta;
        myAscent = ascent;
    }

    @Override
    public int getAscent() {
        return myAscent;
    }
}
